package com.nobuyme.box.toy;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.nobuyme.box.R;
import com.pachong.android.baseuicomponent.fragment.BaseFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public class ToyDetailFragment extends BaseFragment {

    String detail;
    @Bind(R.id.iv_detail_pic)
    ImageView mIvDetailPic;

    public ToyDetailFragment() {
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        detail = getArguments().getString(ToyDetailActivity.DETAIL);

        ButterKnife.bind(this, view);
        Glide.with(getActivity()).load(detail).into(mIvDetailPic);
        return view;
    }

    @Override
    public View createDataView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_toy_detail, null);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
